Page({
    data: {
        deleteShow: !1,
        searchItemShow: !1,
        addressList: [],
        addressType: null
    },
    onLoad: function(e) {
        console.log(e.addressType), this.setData({
            addressType: e.addressType
        });
    },
    getKeyWord: function(e) {
        console.log(e.detail.value);
        var t = this;
        wx.request({
            url: "https://apis.map.qq.com/ws/place/v1/suggestion/?region=西安",
            data: {
                key: "YLFBZ-WHAWI-ZXUGH-53Q65-TOJ7E-ADBNQ",
                keyword: e.detail.value
            },
            method: "GET",
            success: function(e) {
                console.log(e), t.setData({
                    addressList: e.data.data
                });
            },
            fail: function() {
                wx.showToast({
                    title: "请求失败"
                });
            },
            complete: function() {
                wx.showToast({
                    title: "请求成功"
                });
            }
        });
    },
    getFocusHandler: function() {
        this.setData({
            deleteShow: !0,
            searchItemShow: !0
        });
    },
    setFocusHandler: function() {
        this.setData({
            deleteShow: !1
        });
    },
    getAddressHandler: function(e) {
        console.log(e.currentTarget.dataset.index), this.data.addressType, wx.setStorageSync(this.data.addressType, this.data.addressList[e.currentTarget.dataset.index]), 
        wx.navigateTo({
            url: "../driverServer/driverServer"
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        return {
            title: app.shareAppMessage().title,
            imageUrl: app.shareAppMessage().imageUrl,
            desc: app.shareAppMessage().desc,
            path: app.shareAppMessage().path
        };
    }
});